using System;
using UnityEngine;

public static class UserStatistics
{
	private const string SequenceOpenDaysKey = "SequenceOpenDays";

	private const string LastAppSessionKey = "LastOpenApp";

	public static int SequenceOpenDays
	{
		get
		{
			return PlayerPrefs.GetInt("SequenceOpenDays", 0);
		}
		set
		{
			PlayerPrefs.SetInt("SequenceOpenDays", value);
			PlayerPrefs.Save();
		}
	}

	public static DateTime LastAppSession
	{
		get
		{
			return DateTime.Parse(PlayerPrefs.GetString("LastOpenApp", DateTime.MinValue.ToString()));
		}
		set
		{
			PlayerPrefs.SetString("LastOpenApp", value.ToString());
		}
	}

	public static void UpdateAppSessionStatistics()
	{
        return;
		DateTime date = DateTime.Now.Date;
		if ((date - LastAppSession.Date).Days == 1)
		{
			SequenceOpenDays++;
		}
		else if ((date - LastAppSession.Date).Days > 1)
		{
			SequenceOpenDays = 0;
		}
		UnityEngine.Debug.Log("[UserStatistics] Sequence of days opened: " + SequenceOpenDays);
		LastAppSession = DateTime.Now;
	}
}
